<div class="col-md-12">
  <div class="box box-solid">
    <div class="box-header with-border">
    </div>
    <!-- /.box-header -->
    <div *ngIf="!currentUser?.role||currentUser.role=='student'" class="box-body">
      <div class="box" style="margin-top: 1.25rem">
        <div class="box-body no-padding">
          <table class="table table-striped">
            <tr>
              <th>标题</th>
              <th>创建者</th>
              <!--<th>单位</th>-->
              <th>类型</th>
              <th>状态</th>
            </tr>
            <tr *ngFor="let p of problemSets">
              <td><a routerLink="/problem-sets/{{p.code}}/problems">{{p.title}}</a></td>
              <td>{{p.creator}}</td>
              <!--<td>{{p.company}}</td>-->
              <td>{{p.type}}</td>
              <td>{{p.state}}</td>
            </tr>
          </table>
        </div>
      </div>
    </div>
    <!-- /.box-body -->
    <div *ngIf="currentUser?.role&&currentUser.role!='student'" class="box-body">
      <p-tabView [style]="{'border':'0'}" (onChange)="onTabChange($event)" [activeIndex]="nowTab">
        <p-tabPanel header="{{tabHeader}}" [style]="{'border':'0'}" [selected]="showTabFlag">
          <div *ngIf="currentUser.role=='teacher'" style="margin-top: 1.25rem">
            <a routerLink="/problem-sets/newCategory/{{category}}">
              <button class="btn btn-primary">新建题目集</button>
            </a>
          </div>
          <div *ngIf="currentUser.role=='admin'" style="margin-top: 1.25rem">
            <a routerLink="/problem-sets/newCategory/{{category}}">
              <button class="btn btn-primary">新建公共题目集</button>
            </a>
          </div>
          <div class="box" style="margin-top: 1.25rem">
            <div class="box-body no-padding">
              <table class="table table-striped">
                <tr>
                  <th><input type="checkbox" [(ngModel)]="all" (change)="focusAll($event)"></th>
                  <th>标题</th>
                  <th>创建者</th>
                 <!-- <th>单位</th>-->
                  <th>类型</th>
                  <!--<th>状态</th>-->
                  <th>操作</th>
                </tr>
                <tr *ngFor="let p of problemSets">
                  <td><input type="checkbox"></td>
                  <td><a style="color: #3c8dbc;" routerLink="/problem-sets/{{p.code}}/problems">{{p.title}}</a></td>
                  <td>{{p.creator}}</td>
                  <!--<td>{{p.company}}</td>-->
                  <td>{{p.type}}</td>
                  <!--<td>{{p.state}}</td>-->
                  <td><a *ngIf="currentUser.code==p.creator"  routerLink="/problem-sets/update/001/{{p.code}}">修改</a></td>
                </tr>
              </table>
            </div>
          </div>
        </p-tabPanel>
        <!--<p-tabPanel header="+" [selected]="!showTabFlag">-->
          <!--<p-dialog (onHide)="hideDialog($event)" [(visible)]="display" [positionTop]="80" [modal]="true" [responsive]="true" [width]="500" [minWidth]="200" [minY]="70">-->
            <!--<p-header>-->
              <!--新建分类-->
            <!--</p-header>-->
            <!--<input #input (keyup)="changeInput(input.value)" [(ngModel)]="category" style="width: 100%;" placeholder="分类名称(分类仅本人可见)">-->
            <!--<p-footer>-->
              <!--<div style="text-align: center;">-->
                <!--<p-button [disabled]="buttonFlag" (onClick)="createCategory()" label="新建分类"></p-button>-->
              <!--</div>-->
            <!--</p-footer>-->
          <!--</p-dialog>-->
        <!--</p-tabPanel>-->
      </p-tabView>
    </div>
    <!-- /.box-body -->
  </div>
  <!-- /.box -->
</div>
